package com.jqq.homework;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author 姬倩倩
 * @version 1.0
 */
public class Homework04 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入字符串：");
        String str = scanner.nextLine();
        if (str == null) {
            System.out.println("str不能为null");
        }
        char[] strs = str.toCharArray();
        int lowCharCount = 0;
        int upCharCount = 0;
        int numCount = 0;
        for (char c : strs) {
            if (c >= 'a' && c <= 'z') {
                lowCharCount++;
            } else if (c >= 'A' && c <= 'Z') {
                upCharCount++;
            } else if (c >= '0' && c <= '9') {
                numCount++;
            }
        }
        System.out.println("该字符串中 大写字母个数:" + upCharCount +
                "，小写字母个数:" + lowCharCount + "，数字个数:" + numCount);
    }
}
